import request from '@/utils/request'

// 查询过程检验单行列表
export function templateindexList(query) {
  return request({
    url: '/mes/qc/templateindex/list',
    method: 'get',
    params: query
  })
}
// ?pageNum=1&pageSize=10&templateId=6

// 查询检测项列表
export function listInspection(query) {
  return request({
    url: '/mes/head/list',
    method: 'get',
    params: query
  })
}

// 查询检测项详细
export function getInspection(indexId) {
  return request({
    url: '/mes/head/' + indexId,
    method: 'get'
  })
}
// 复核查询检测项详细
export function getCheckItems(indexId) {
  return request({
    url: '/mes/head/getCheckItems',
    method: 'get',
    params:{id: indexId}
  })
}
// 获取异常检查项列表
export function listError(query) {
  return request({
    url: 'mes/ipqc/base/inspection/indexType/listByTemplateId',
    method: 'get',
    params: query
  })
}
// 新增检测项
export function addInspection(data) {
  return request({
    url: '/mes/fqc/inspection',
    method: 'post',
    data: data
  })
}

// 修改检测项
export function updateInspection(data) {
  return request({
    url: '/mes/qc/inspection',
    method: 'put',
    data: data
  })
}

// 查看bom清单详情
export function fqcBom(data) {
  return request({
    url: '/mes/fqc/inspection/fqc/bom',
    method: 'post',
    data: data
  })
}


// 删除检测项
export function delInspection(indexId) {
  return request({
    url: '/mes/qc/inspection/' + indexId,
    method: 'delete'
  })
}

//验证SN码是否正确
export function checkSncode(query) {
  return request({
    url: '/mes/head/foolProofing',
    method: 'get',
    params: query
  })
}
//获取FQC检验对应的SN编码
export function getFqcSnCode(fqcCode) {
  return request({
    url: '/mes/pro/reportSn/' + fqcCode,
    method: 'get'
  })
}

export function getFQCInfo(Id) {
  return request({
    url: '/mes/fqcInspection/records/' + Id,
    method: 'get'
  })
}

// 详情
export function getFqcDtoInfo(query) {
  return request({
    url: '/mes/fqcInspection/records/getFqcDtoInfo',
    method: 'get',
    params: query
  })
}
// 下载详情接口
export function exportFqcInfo(data) {
  return request({
    url: '/mes/fqcInspection/records/export/fqcInfo',
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}
// 导出详情接口
export function exportFqcInfo2(data) {
  return request({
    url: '/mes/qc/oqcRecords/export/detail',
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}

// 2024-12-13 撤回
export function revoke(query) {
  return request({
    url: "/mes/head/revoke",
    method: "get",
    params: query,
  });
}


// 2024-12-27 djj 新增 复验页面的提交接口
export function inspectionQE(data) {
  return request({
    url: '/mes/head/submitQEInspect',
    method: 'post',
    data: data
  })
}


//2024-12-27 djj 新增 复核详情 接口
export function queryLineList(query) {
  return request({
    url: "/mes/back/approveline/queryLineList",
    method: "get",
    params: query,
  });
}

/* 2024-12-29 djj 新增 驳回 接口 */
export function fqcReject(data) {
  return request({
    url: "/mes/head/fqcReject",
    method: "post",
    data: data,
  });
}